#pragma once
#include"public_struct.h"
class NumArray {
public:
	vector<int> sums;
	NumArray(vector<int>& nums) {
		sums.resize(nums.size() + 1);
		sums[0] = 0;
		for (int i = 1; i <= nums.size(); ++i)
			sums[i] = sums[i - 1] + nums[i - 1];
	}
	int sumRange(int i, int j) {
		return sums[j + 1] - sums[i];
	}
};